package service;

import dao.Dao;
import dao.DaoImpl;
import domain.Product;
import utils.PageBean;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by guo on 2017/10/29.
 */
public class ServiceImpl implements Service{
    Dao dao=new DaoImpl();
    @Override
    public List<Product> findAll() {
        return dao.findAll();
    }

    @Override
    public int deleteById(int pid) {
        return dao.deleteById(pid);
    }

    @Override
    public List<Product> Search(String pnamme) throws SQLException {
        return dao.Search(pnamme);
    }

    @Override
    public int Add(Product product) {
        return dao.Add(product);
    }



    @Override
    public Product findById(int pid) {
        return dao.findById(pid);
    }

    @Override
    public int Update(Product product) {
        return dao.Update(product);
    }

    @Override
    public PageBean findPage(int currentPage, int pageSize) {
        return dao.findPage(currentPage,pageSize);
    }
}
